package com.plter.controls.plter
{
	
	import flash.display.Shape;
	
	public class PUIComponent extends PSprite
	{
		private var _maskShape:Shape;
		
		public function PUIComponent()
		{
			super();
		}
		
		private var _useMask:Boolean=false;

		public function get useMask():Boolean
		{
			return _useMask;
		}

		public function set useMask(value:Boolean):void
		{
			_useMask = value;
			
			if(value){
				_maskShape=new Shape;
				_maskShape.graphics.beginFill(0x000000);
				_maskShape.graphics.drawRect(0,0,100,100);
				_maskShape.graphics.endFill();
				_maskShape.width=this.width;
				_maskShape.height=this.height;
				this.mask=_maskShape;
			}else{
				this.mask=null;
			}
		}

		
		private var _width:Number=0;

		public override function get width():Number
		{
			return _width;
		}
		
		public override function set width(value:Number):void{
			_width=value;
			if(this.useMask){
				this.mask.width=value;
			}
		}
		
		private var _height:Number=0;

		public override function get height():Number
		{
			return _height;
		}

		public override function set height(value:Number):void
		{
			_height = value;
			if(this.useMask){
				this.mask.height=value;
			}
		}

	}
}